﻿using System;
using UnityEngine;

namespace UnityGameUI
{
	// Token: 0x02000005 RID: 5
	public class TooltipGUI : MonoBehaviour
	{
		// Token: 0x0600000B RID: 11 RVA: 0x000020EE File Offset: 0x000002EE
		public TooltipGUI()
		{
			TooltipGUI.instance = this;
		}

		// Token: 0x0600000C RID: 12 RVA: 0x000020FC File Offset: 0x000002FC
		public void OnGUI()
		{
			if (!TooltipGUI.fired)
			{
				Debug.Log("TooltipGUI OnGUI Fired");
				TooltipGUI.fired = true;
			}
			if (TooltipGUI.Tooltip != "" && TooltipGUI.EnableTooltip)
			{
				GUI.backgroundColor = Color.black;
				GUIContent content = new GUIContent(TooltipGUI.Tooltip);
				TooltipGUI.tooltipStyle = new GUIStyle(GUI.skin.box);
				TooltipGUI.tooltipStyle.normal.textColor = Color.white;
				float width = TooltipGUI.tooltipStyle.CalcSize(content).x;
				TooltipGUI.tooltipStyle.CalcSize(content);
				Vector3 mousepos = Input.mousePosition;
				GUI.Box(new Rect(mousepos.x + 15f, (float)Screen.height - mousepos.y + 15f, width, 25f), content, TooltipGUI.tooltipStyle);
			}
		}

		// Token: 0x04000001 RID: 1
		public static TooltipGUI instance = null;

		// Token: 0x04000002 RID: 2
		public static bool EnableTooltip = true;

		// Token: 0x04000003 RID: 3
		public static string Tooltip = "";

		// Token: 0x04000004 RID: 4
		private static GUIStyle tooltipStyle;

		// Token: 0x04000005 RID: 5
		private static bool fired = false;
	}
}
